<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>JS 代码示例</title>
</head>
<body>
<script>
  //script 标签里的内容
  alert("hello world");
</script>
<!-- <script src="app.js"></script> -->
<div onclick="alert('点就点了，能咋地')">点我试试 </div>
<script>
  console.log('hello');
</script>
<script>
 // var n = 10;
 // var name = '张三';
  let n2=20;
  let name2 = '李四';
  let n3 = 10;//此时n3是number类型
  console.log(typeof(n3));
  n3='hello';//此时n3是String类型
  console.log(typeof(n3));
  n3=true;
  console.log(typeof(n3));
  console.log(n3+1);
 // var a;
 // console.log(a);
  console.log(typeof(undefined));//undefined
  console.log(typeof(null));//object
  let b = 10;
  let c = '10';
  console.log(b==c);//true
  console.log(b===c);//false
  let arr0 = new Array();//创建数组
  let arr1 = [];//创建数组第二种写法
  let arr2 = [1,2,3,4];
  let arr3 = [1,'hello',true,null];
  console.log(arr3);
  let arr = ['咬人猫','兔总裁','张奶糖'];
  console.log(arr[0]);
  console.log(arr[1]);
  console.log(arr[2]);
  arr[2]='汤老师';
  console.log(arr);


</script>

</body>
</html>